﻿using System.Collections.Generic;

namespace Inscriptionem.Models.Blog.Views.Controls
{
    public class HorizontalMenuViewModel : Base.BaseRequestModel
    {
        public HorizontalMenuViewModel(Base.BaseViewModel model)
        {
            this.Section = model.Section;
            this.Language = model.Language;

            this.Categories = model.Categories;
            this.Pages = model.Pages;

            if (model is CategoryViewModel)
            {
                var cmodel = model as CategoryViewModel;
                this.SelectedItemID = cmodel.Category == null ? 0 : cmodel.Category.ID;
            }
        }

        public int SelectedItemID { get; set; }

        public IEnumerable<ORM.Page> Pages { get; set; }

        public IEnumerable<ORM.Category> Categories { get; set; }
    }
}